#include "StdAfx.h"
#include "component_interval.h"
#include "tools.h"

component_interval::component_interval(void)
{
}


component_interval::~component_interval(void)
{
}

void component_interval::draw(float* start, float* end, float start_dist, float end_dist, float* delta)
{

	//position
	float towards[3] = {end[0]-start[0], end[1]-start[1], end[2]-start[2]};
	float path_length = end_dist - start_dist;
	//phrase
	float start_phrase = phrase + start_dist / cycle;
	float cur_dist_along_path = cycle * (1.0f - float_mod(start_phrase, 1.0f));
	for(;cur_dist_along_path < path_length; cur_dist_along_path += cycle)
	{
		float position[3] = {start[0] + cur_dist_along_path * towards[0]/path_length,
							start[1] + cur_dist_along_path * towards[1]/path_length,
							start[2] + cur_dist_along_path * towards[2]/path_length};
		draw_element(position, delta, towards);
	}
}

void component_interval::draw_corner(float *previous_point, float *cur_point, 
										float* previous_delta, float *cur_delta, 
										float* center_point, float corner_radius)
{
	/*
	float delta[3] = { (cur_delta[0] + previous_delta[0])*0.5f,
		0.0f,
		(cur_delta[2] + previous_delta[2])*0.5f};
	float towards[3] = { cur_point[0]-previous_point[0],
		0.0f,
		cur_point[2] - previous_point[2]};
	draw_element(center_point, delta, towards);
	*/
}
